function para =  setPara(SO,OD,scale,nx,ny,nv,nt,dy_det,y_os,sd_phi,y_det,y_det2)

Id_v=cell(1,nt);
Id_v{1}=uint32(0:nv-1);
id_X=[];Nv=zeros(1,nt);
for i=1:nt
    id_X=[id_X (i-1)*ones(1,numel(Id_v{i}))];
    Nv(i)=numel(Id_v{i});
end
tmp_size=max(Nv);
id_Y=zeros(tmp_size,nt);
for i=1:nt
    id_Y(1:Nv(i),i)=Id_v{i};
end

para.id_X =uint32(id_X);



para=struct('version',[],'GPU',[],...
    'SO',single(SO),'OD',single(OD),'scale',single(scale),'nx',uint32(nx),'ny',uint32(ny),'nv',uint32(nv),...
    'sd_phi',sd_phi,'y_det',y_det,'id_X',uint32(id_X),'nt',uint32(nt),'dy_det',dy_det,'y_os',y_os,...
    'id_Y',uint32(id_Y),'Nv',uint32(Nv),'tmp_size',uint32(tmp_size),...
    'cos_phi',cos(sd_phi),'sin_phi',sin(sd_phi),'cos_det',[],'sin_det',[],'y_det2',y_det2);


angle_det=atan2(y_det,SO+OD);para.cos_det=cos(angle_det);para.sin_det=sin(angle_det);
angle_det2=atan2(y_det2,SO+OD);para.cos_det2=single(cos(angle_det2));para.sin_det2=single(sin(angle_det2));% for finite-size beam

end